package com.linchuan.concurrency;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class ThreadPerTaskWebServer {
  public static void handleRequest(Socket socket) {}

  public static void main(String[] args) throws IOException {
    ServerSocket socket = new ServerSocket(8081);
    while (true) {
      final Socket connection = socket.accept();
      Runnable task = () -> handleRequest(connection);
      new Thread(task).start();
    }
  }
}
